public class ext_InspectionReport 
{
    Public List<Application__c> Applications {get; set;}
    Public string check {get; set;}
    Public List<PCWrap> PCWrapList {get; set;}
    public ext_InspectionReport(ApexPages.StandardController controller) 
    {
        Applications = new List<Application__c>();
        PCWrapList = new List<PCWrap>();
        try{
            Applications = [SELECT id, Name, Name_of_Applicant__r.Name, Inspection_Number__c FROM Application__c WHERE Inspection_Number__c = :ApexPages.CurrentPage().getParameters().get('id')];
            Boolean Even_flag = true;
            Integer ListSize = Applications.size();
            Integer Mid = Applications.size() / 2;
            
            System.debug('in test Class The Application Page Id => '+ ApexPages.CurrentPage().getParameters().get('id'));
            System.debug('The SIze of the Application is ='+ Applications.size()+'The MOdulus of the Application Size is => '+ math.mod(Applications.size(), 2));
            if(math.mod(Applications.size(), 2) != 0)
            {
                Even_flag = false;
                Mid = Integer.ValueOf(math.floor(Applications.size() / 2)) + 1;
                ListSize++;
            }
            check = String.ValueOf(ListSize);
            integer counter = 0;
            for(integer count = 1; count <= ListSize; count++)
            {   
                counter++;
                PCWrap temp = new PCWrap();
                temp.Counter1 = String.Valueof(counter);
                temp.ApplicationNumber1 = Applications[count - 1].Name;
                temp.Name1 = Applications[count - 1].Name_of_Applicant__r.Name;
                count++;
                if(count > Applications.size())
                {    
                    temp.Counter2 = '';
                    temp.ApplicationNumber2 = '';
                    temp.Name2 = '';
                }
                else
                {
                    Mid++;
                    temp.Counter2 = String.Valueof(Mid);
                    temp.ApplicationNumber2 = Applications[count - 1].Name;
                    temp.Name2 = Applications[count - 1].Name_of_Applicant__r.Name;
                }
                
                PCWrapList.Add(temp);
            }
        }
        catch(System.Exception er)
        {    
            Applications = new List<Application__c>();
        }
    }
    
    Public Class PCWrap
    {
        Public String Counter1 {get; set;}
        Public String ApplicationNumber1 {get; set;}
        Public String Name1 {get; set;} 
        Public String Counter2 {get; set;}
        Public String ApplicationNumber2 {get; set;}
        Public String Name2 {get; set;} 
    }
    
    /*public static testMethod void testMyController() 
    {
        //PageReference pageRef = Page.vfp_inspection;
        //Test.setCurrentPage(pageRef);
        
        //Inspection__c ins = [SELECT id, Name FROM Inspection__c LIMIT 1];
        //Created By Mustafa...
        
        //Account Object Record...
        Account accountObject1 = new Account();
        accountObject1.Name = 'Test Account';
        accountObject1.License_Application_Step__c = 'Record Created';
        accountObject1.License_Application_Type__c = 'New License';
    	accountObject1.Activity__c = 'Trading - One Activity';
    	accountObject1.License_Issue_Date__c = system.today();
    	accountObject1.License_Expiry_Date__c = System.Today().addYears(1);
    	insert accountObject1;
    	
        RecordType rt = [select id,Name from RecordType where sObjectType=:'Application__c' and name =:'Employment'];  
    	string recordType15DigitId =rt.Id;
    	recordType15DigitId = recordType15DigitId.substring(0,recordType15DigitId.length()-3);
    	
    	Inspection__c ins = new Inspection__c();
        ins.Active__c = 'Yes';
        ins.Company__c = accountObject1.id;
        insert ins;
        
    	//Application Object...
    	Application__c testapp = new Application__c(Inspection_Number__c = ins.id,Transaction_Number__c = 'Test ',RecordType = rt,RecordTypeId = rt.id,Applicant_First_Name__c='Test',Applicant_Last_Name__c='test',Company__c=accountObject1.id,Passport_Number__c='test',Ultimus_Receipt_Number__c='test');
    
    	ApexPages.currentPage().getParameters().put('id', String.Valueof(ins.id));
        System.debug('The Test App Debug = > '+ testapp.Inspection_Number__c + ' && the Page Id => ' +  ApexPages.currentPage().getParameters().get('id'));
        
        
        ApexPages.StandardController mcontroller = new ApexPages.StandardController(ins);
        ext_InspectionReport controller = new ext_InspectionReport(mcontroller); 
    }*/
}